package com.fish.common.jms;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;



public class TopicMessageConsumer {
	
	private static final Log log = LogFactory.getLog(TopicMessageConsumer.class);
	
	private List<MessageProcesser> processerList = new ArrayList<MessageProcesser>();
	
	public void receive(Message m) {
		log.info(m);
		for(int i=0;i<processerList.size();i++) {
			try{
				processerList.get(i).process(m);
			}catch(Exception e) {
				e.printStackTrace();
			}
		}
	}
	
	public void setProcesserList(List<MessageProcesser> processerList) {
		this.processerList = processerList;
	}

}
